
package me.zhengjie.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.sql.Timestamp;
import java.io.Serializable;

/**
* @website https://el-admin.vip
* @description /
* @author IQW
* @date 2022-07-13
**/
@Entity
@Data
@Table(name="app_work_config")
public class AppWorkConfig implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "config_id")
    @ApiModelProperty(value = "配置ID")
    private Integer configId;

    @Column(name = "area_id")
    @ApiModelProperty(value = "责任区ID")
    private Integer areaId;

    @Column(name = "title",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "任务名称")
    private String title;

    @Column(name = "type")
    @ApiModelProperty(value = "类型")
    private Integer type;

    @Column(name = "zhiwu_id")
    @ApiModelProperty(value = "选择职务类型")
    private String zhiwuId;

    @Column(name = "label")
    @ApiModelProperty(value = "任务类型")
    private String label;

    @Column(name = "jjcd")
    @ApiModelProperty(value = "紧急程度")
    private String jjcd;

    @Column(name = "note")
    @ApiModelProperty(value = "内容")
    private String note;

    @Column(name = "address")
    @ApiModelProperty(value = "地址")
    private String address;

    @Column(name = "lon")
    @ApiModelProperty(value = "经度")
    private Double lon;

    @Column(name = "lat")
    @ApiModelProperty(value = "纬度")
    private Double lat;

    @Column(name = "start_time")
    @ApiModelProperty(value = "开始时间")
    private Timestamp startTime;

    @Column(name = "end_time")
    @ApiModelProperty(value = "结束时间")
    private Timestamp endTime;

    @Column(name = "num")
    @ApiModelProperty(value = "巡护频次")
    private Integer num;

    @Column(name = "danwei")
    @ApiModelProperty(value = "频次单位 1天2周3月4年")
    private String danwei;

    @Column(name = "to_area_id")
    @ApiModelProperty(value = "对象责任区ID")
    private Integer toAreaId;

    @Column(name = "to_type")
    @ApiModelProperty(value = "对象类型")
    private Integer toType;

    @Column(name = "uids")
    @ApiModelProperty(value = "选择人员ID")
    private String uids;

    @Column(name = "zx_date")
    @ApiModelProperty(value = "zxDate")
    private Timestamp zxDate;

    @Column(name = "status")
    @ApiModelProperty(value = "状态")
    private Integer status;

    @Column(name = "create_time")
    @ApiModelProperty(value = "createTime")
    private Timestamp createTime;

    @Column(name = "update_time")
    @ApiModelProperty(value = "updateTime")
    private Timestamp updateTime;

    public void copy(AppWorkConfig source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}